<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 活动（游戏、抽奖、大屏幕）
 */
class Activity extends Model
{
	use SoftDeletes;

	protected $fillable = ['user_id', 'title', 'type', 'bg_image_url', 'game_bg_url', 'counts', 'qrcode_image_url', 'start_time', 'end_time'];

    public static function getUserIdByActivityId($activity_id = 0)
    {
    	return self::where(['activity_id' => $activity_id])->value('user_id');
	}
}
